using System.Linq;
using Microsoft.Samples.ServiceHosting.StorageClient;

namespace BlogEngine.Core.Azure.BlogProvider
{
    public class BlogDataServiceContext : TableStorageDataServiceContext
    {
        private IQueryable<T> CreateQuery<T>()
            where T : Tables.Row
        {
            return CreateQuery<T>(typeof(T).Name);
        }

        public IQueryable<Tables.BlogRollItem> BlogRollItem
        {
            get { return CreateQuery<Tables.BlogRollItem>(); }
        }

        public IQueryable<Tables.Category> Category
        {
            get { return CreateQuery<Tables.Category>(); }
        }

        public IQueryable<Tables.Comment> Comment
        {
            get { return CreateQuery<Tables.Comment>(); }
        }

        public IQueryable<Tables.DataStoreSetting> DataStoreSetting
        {
            get { return CreateQuery<Tables.DataStoreSetting>(); }
        }

        public IQueryable<Tables.Page> Page
        {
            get { return CreateQuery<Tables.Page>(); }
        }

        public IQueryable<Tables.PingService> PingService
        {
            get { return CreateQuery<Tables.PingService>(); }
        }

        public IQueryable<Tables.Post> Post
        {
            get { return CreateQuery<Tables.Post>(); }
        }

        public IQueryable<Tables.PostCategory> PostCategory
        {
            get { return CreateQuery<Tables.PostCategory>(); }
        }

        public IQueryable<Tables.PostNotification> PostNotification
        {
            get { return CreateQuery<Tables.PostNotification>(); }
        }

        public IQueryable<Tables.PostTag> PostTag
        {
            get { return CreateQuery<Tables.PostTag>(); }
        }

        public IQueryable<Tables.Referrer> Referrer
        {
            get { return CreateQuery<Tables.Referrer>(); }
        }

        public IQueryable<Tables.Setting> Setting
        {
            get { return CreateQuery<Tables.Setting>(); }
        }

        public IQueryable<Tables.StopWord> StopWord
        {
            get { return CreateQuery<Tables.StopWord>(); }
        }
    }
}